package com.glory.dmegcpda.fragment

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.glory.dmegcpda.R
import com.glory.dmegcpda.view.CheckTaskListActivity
import com.glory.dmegcpda.view.KeepTaskListActivity
import com.glory.dmegcpda.view.QualityCheckActivity
import com.glory.dmegcpda.view.QualityPatrolActivity
import com.glory.dmegcpda.viewmodel.FirstFragmentModel
import com.glory.mvvmnet.base.BaseFragment
import kotlinx.android.synthetic.main.eqptext_fragment.*

class EqpTextFragment : BaseFragment<FirstFragmentModel>(), View.OnClickListener {

    override fun layoutId(): Int {
        return R.layout.eqptext_fragment
    }

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        llKeep.setOnClickListener(this)
        llCheck.setOnClickListener(this)
    }

    override fun initData() {
        super.initData()

    }

    override fun onClick(p: View?) {
        val intent = Intent()
        when (p?.id) {
            R.id.llKeep ->{
                activity?.let { intent.setClass(it, KeepTaskListActivity::class.java) }
            }
            R.id.llCheck ->{
                activity?.let { intent.setClass(it, CheckTaskListActivity::class.java) }
            }
        }
        startActivity(intent)
    }

}